package com.sanjiahantang.youjiaclient.module.money.views.impl;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.sanjiahantang.uilibrary.utils.Utils;
import com.sanjiahantang.youjiaclient.R;
import com.sanjiahantang.youjiaclient.base.BaseMvpActivity;
import com.sanjiahantang.youjiaclient.base.BaseMvpPresenter;
import com.sanjiahantang.youjiaclient.module.money.presenters.MoneyPresenter;
import com.sanjiahantang.youjiaclient.module.money.views.MoneyView;

import net.lucode.hackware.magicindicator.buildins.UIUtil;

public class MeAddBankVerifyActivity extends BaseMvpActivity<MoneyView, MoneyPresenter> implements MoneyView, View.OnClickListener {
    private TextView btnComfirm;
    private EditText editVerifyCode;
    private View fl_Left;

    @Override
    public MoneyPresenter initPresenter() {
        return new MoneyPresenter();
    }

    @Override
    public void initView() {
        setContentView(R.layout.activity_add_bank_verify);
        fl_Left = findViewById(R.id.fl_Left);
        fl_Left.setOnClickListener(this);
        btnComfirm = (TextView) this.findViewById(R.id.btnComfirm);
        editVerifyCode = (EditText) this.findViewById(R.id.editVerifyCode);
        btnComfirm.setOnClickListener(this);
        TextView title = (TextView) findViewById(R.id.title);
        title.setText("绑定银行卡验证");
    }

    @Override
    public void initData() {

    }

    @Override
    public void showProgress() {

    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btnComfirm:
                String cardNo = getIntent().getStringExtra(KEY_ID);
                presenter.cardBindingSMS(this, cardNo, editVerifyCode.getText().toString(), new OnLoadListener() {
                    @Override
                    public void onLoad(Object content) {
                        if (content != null) {
                            finish();
                        }
                    }
                });
                break;
            case R.id.fl_Left:
                finish();
                break;
        }
    }

    public static void startActivity(Context context, String bankCardNo) {
        Intent intent = new Intent(context, MeAddBankVerifyActivity.class);
        intent.putExtra(KEY_ID, bankCardNo);
        context.startActivity(intent);
    }
}
